package com.simple.datax.utils;
/** 
 * @Title: SimpleConstants.java 
 * @Package com.simple.datax.utils 
 * @Description: 定义系统中使用的常量
 * @author Paladin Chen 
 * @date 2012-12-21 下午9:26:35 
 * @version V1.0 
 */
public class SimpleConstants {
	//流程处理的通讯参数后缀
	//用来区分是系统内部消息，在recv_channel中，communType配置时使用，如：FTP。FLOW，表示是从FLOW发送过来的消息；
	//目前是RPC调用，没有配置，当内部msg和外部处理一致时，需要使用。
	public static String FLOW_COMMTYPE_POSTFIX="FLOW";
	
    // 报文状态
	public static short STATUS_RECV = (short)1;
	public static short STATUS_PARSE = (short)2;
	public static short STATUS_SENT = (short)3;
	public static short STATUS_RESENT = (short)4;
	public static short STATUS_DISUSED = (short)5;
	public static short STATUS_FAILED = (short)6;
	
	// 数据库错误状态
	public static short ERROR_LEVEL_NORMAL = (short)0; // 一般性错误，不影响其它同种报文的流转；
	public static short ERROR_LEVEL_CLASS = (short)1; // 类型级错误，同种类型报文无法流转；
	public static short ERROR_LEVEL_PLATFORM = (short)2; // 系统级错误，平台所有报文无法流转；
	
	public static short ERROR_TYPE_RECV = (short)0; // 报文接收层错误；
	public static short ERROR_TYPE_DATAXPROC = (short)1; // 平台报文处理层错误；
	public static short ERROR_TYPE_SUBPROC = (short)2; // 业务子系统报文处理层错误；
	public static short ERROR_TYPE_SEND = (short)3; // 报文发送层错误；
	public static short ERROR_TYPE_UNKOWN = (short)-1; // 未知错误； 
	public static short ERROR_TYPE_RESEND = (short)4; // 重发达最大次数错误； 
	
	
	public static short ERROR_STATUS_INIT = (short)0; // 未处理，错误创建时缺省状态 ；
	public static short ERROR_STATUS_RESP = (short)1; // 已反馈，已经将该错误以邮件或短信的形式反馈给相关人员；
	public static short ERROR_STATUS_SLV = (short)2; // 已解决，排除了该错误或找到了解决办法。
		
	// 定义各类报文头的最小长度	
	public static int COMMON_HEADER_LENGTH = 200;
	public static int EC_XML_HEADER_LENGTH = 400;
	public static int TCS_XML_HEADER_LENGTH = 400;
	
	//responsecode and response msg
	public static int RESPONSE_CODE_NORMAL = 0;
	public static String RESPONSE_MSG_NORMAL = "报文已被交换平台成功接收。";

	public static int RESPONSE_CODE_PARSE = -12344;
	public static String RESPONSE_MSG_PARSE = "报文解析出错。";

	public static int RESPONSE_CODE_VALIDATER = -12346;
	public static String RESPONSE_MSG_VALIDATER = "报文验证出错。";
	
	public static int RESPONSE_CODE_INMAPPING = -12347;
	public static String RESPONSE_MSG_INMAPPING = "报文转换成平台格式出错。";
	
	public static int RESPONSE_CODE_ROUTE = -12345;
	public static String RESPONSE_MSG_ROUTE = "获取接收物理地址时出错。";
	
	public static int RESPONSE_CODE_OUTMAPPING = -12348;
	public static String RESPONSE_MSG_OUTMAPPING = "平台格式报文转换成接收者格式时出错。";
	
	public static int RESPONSE_CODE_SENDER = -12349;
	public static String RESPONSE_MSG_SENDER = "报文发往接收者时出错。";
	
	public static int RESPONSE_CODE_COMPRESS = -12350;
	public static String RESPONSE_MSG_COMPRESS = "报文压缩出错。";
	
	public static int RESPONSE_CODE_UNCOMPRESS = -12351;
	public static String RESPONSE_MSG_UNCOMPRESS = "报文解压出错。";
	
	public static int RESPONSE_CODE_UNKNOWN = -12343;
	public static String RESPONSE_MSG_UNKNOWN = "报文处理未知错误。";
	
	public static int RESPONSE_CODE_RESEND = -12342;
	public static String RESPONSE_MSG_RESEND = "系统尝试处理报文达最大次数仍未成功，请联系交换平台管理员检查系统。";
	
}
